import http from '@/utils/request.js'

export default {
        add:(obj)=>{
            return http({
                url:'/api/user',
                method:'post',
                data:obj,
                headers: {
                    //定义将数据以json的形式传入后台(java)
                    'Content-Type': 'application/json'
                }
            });
        },
        edit:(obj)=>{
            return http({
                url:'/api/user',
                method:'put',
                data:obj,   //json数据
                headers: {
                    //定义将数据以json的形式传入后台(java)
                    'Content-Type': 'application/json'
                }
            });
        },
        del:(id)=>{
            return http({
                url:'/api/user/'+id,
                method:'delete'
            });
        },
        // params接受表单数据
        page:(obj)=>{
            return http({
                url:'/api/user/page',
                method:'get',
                params:obj   //表单
            });
        },


}